﻿/********************************************************************************************************************
* Author:	Aristidis Mihail																						*
* Email:	std03055@di.uoa.gr																						*
* Purpose:	This script is used in order to create the stored procedure "usp_user_get_categories_userOf" that		*
*			returns the private categories a user can see															*
********************************************************************************************************************/


CREATE PROCEDURE [dbo].[usp_categories_get_categories_userOf]

@Userid bigint	
AS

	SELECT [Category-User].CategoryID, Categories.Name
	FROM [Category-User] , Categories
	WHERE [Category-User].UserID = @Userid AND Categories.IsDeleted = 0 AND CategoryID=ID and [Category-User].CategoryID = Categories.ID
	
RETURN 0